Repository navigation
v0.3.2: safer connection check and first() error handling - #5
Merged
Merged
Conversation
…ndling
Make treats HTTP 400-599 as errors, so the empty address-verify connection
check could not succeed. The check now POSTs a fixed autocomplete query and
is valid only on 2xx responses that include body.result, so a 200 HTML page
is rejected as InvalidAccessTokenError.
first() on Get Property Details, Verify Address, and the billed instant
trigger's property lookup is guarded with ifempty(..., emptyarray). Those
modules also set response.valid so a 401 JSON body or HTML page surfaces as
InvalidAccessTokenError instead of IMLError ("Invalid array"). Tests cover
the new connection check, the guards, and the error type.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
/v1/address/verifytest always failed. The check now POSTs a fixed autocomplete query (searchCriteria.query=1600 Penn, take 1) and is valid only on HTTP 2xx whenbody.resultis present. A 200 HTML error page is rejected asInvalidAccessTokenError.first()mappings. Get Property Details, Verify Address, and the billed instant trigger's property lookup usefirst(ifempty(path, emptyarray))plusresponse.valid. A 401 JSON body or a 200 HTML page now surfaces asInvalidAccessTokenErrorinstead ofIMLError: Function 'first' finished with error! Invalid array.The shared
catalog.jsonis unchanged. npm test is 80/80.Why
A Make review scenario that used an invalid token failed with
IMLErroronfirst()instead ofInvalidAccessTokenError, because Make evaluated the output mapping on a 200 HTML body (and would do the same on a 401 JSON body that has noresultsarray).